var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, a) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var a in e)
              Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
          })(e, a);
      };
      return function (e, a) {
        function o() {
          this.constructor = e;
        }
        if ("function" != typeof a && null !== a)
          throw new TypeError(
            "Class extends value " + String(a) + " is not a constructor or null"
          );
        t(e, a),
          (e.prototype =
            null === a
              ? Object.create(a)
              : ((o.prototype = a.prototype), new o()));
      };
    })(),
  TaskboardView = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        (e.onLoadTaskListData = {
          caller: e,
          code: 1150,
          method: function (t) {
            (e.dataSource = []),
              (e.list_task.dataSource = e.dataSource),
              (e.taskArray = []),
              (e.taskArray = t.list);
            for (var a = 0; a < e.taskArray.length; a++)
              WebSocketService.send({ c: 1152, d: { mid: e.taskArray[a].id } });
          },
        }),
        (e.onLoadTaskDetailData = {
          caller: e,
          code: 1152,
          method: function (t) {
            e.onloadListData(t.data);
          },
        }),
        e.setupTaskListUI(),
        e.btn_taskCancle.on(Laya.Event.CLICK, e, e.onBackActionFn),
        e.btn_task_tip.on(Laya.Event.CLICK, e, e.onTaskTipAction),
        WebSocketService.addListener(e.onLoadTaskListData, !0),
        WebSocketService.addListener(e.onLoadTaskDetailData, !0),
        e
      );
    }
    return (
      __extends(e, t),
      (e.prototype.setupTaskListUI = function () {
        this.list_task.vScrollBarSkin = "";
      }),
      (e.openTaskView = function () {
        null == this.taskboardVC && (this.taskboardVC = new e()),
          WebSocketService.send({ c: 1150, d: { pageNum: 0 } });
        var t = "item_" + Global.roleId;
        return (
          "task_off" == laya.net.LocalStorage.getItem(t)
            ? ((this.taskboardVC.btn_task_tip.label = "关闭"),
              (this.taskboardVC.btn_task_tip.gray = !0))
            : ((this.taskboardVC.btn_task_tip.label = "开启"),
              (this.taskboardVC.btn_task_tip.gray = !1)),
          this.taskboardVC
        );
      }),
      (e.prototype.onTaskTipAction = function (t) {
        var e = "item_" + Global.roleId;
        "task_off" == laya.net.LocalStorage.getItem(e)
          ? (laya.net.LocalStorage.setItem(e, ""),
            (this.btn_task_tip.label = "开启"),
            (this.btn_task_tip.gray = !1))
          : (laya.net.LocalStorage.setItem(e, "task_off"),
            (this.btn_task_tip.label = "关闭"),
            (this.btn_task_tip.gray = !0)),
          Laya.stage.event("HomePageView", "update_task_view"),
          Laya.stage.event("GameMainView", "update_task_view");
      }),
      (e.prototype.showRichText = function (t, e, a) {
        for (var o = e.split("#$#$"), n = "", i = 0; i < o.length; i++) {
          n =
            "<span style='color:#" +
            a[i].split("#$#$")[i] +
            ";'>" +
            o[i] +
            "</span>";
        }
        t.textfield.textContent = n;
      }),
      (e.prototype.onSelect = function (t) {}),
      (e.prototype.onloadListData = function (t) {
        t.ts;
        t.yq || (t.yq = "");
        var e = {};
        (e = {
          taskTitle: { text: t.name },
          taskDescr: { text: t.ts },
          taskYq: { text: t.yq },
        }),
          this.dataSource.push(e),
          (this.list_task.dataSource = this.dataSource);
      }),
      (e.prototype.onBackActionFn = function () {
        this.removeSelf();
      }),
      e
    );
  })(ui.TaskboardViewUI),
  Item = (function (t) {
    function e() {
      var a = t.call(this) || this;
      return (
        (a.textfield = null),
        a.size(e.WID, e.HEI),
        null == a.textfield &&
          ((a.textfield = new Laya.HTMLDivElement()), a.addChild(a.textfield)),
        (a.textfield.width = Laya.stage.width - 20),
        (a.textfield.x = 10),
        (a.textfield.style.color = "#c0c0c0"),
        (a.textfield.style.fontSize = 15),
        (a.textfield.style.valign = "left"),
        a
      );
    }
    return __extends(e, t), (e.WID = 370), (e.HEI = 85), e;
  })(Laya.Box);
